using Zhaoxi.Zhihu.SharedKerel.Domain;
using Zhaoxi.Zhihu.SharedKerel.Repositoy;

namespace Zhaoxi.Zhihu.Infrastructure.Repositories;

public class EfGenericRepository<T> (AppDbContext  dbContext): EfReadRepository<T>(dbContext), IGenericRepository<T> where T : class,IEntity<int>
{
    private readonly AppDbContext _dbContext = dbContext;
    
    public async Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
    {
        return await _dbContext. SaveChangesAsync(cancellationToken);
    }
}